<?php 
$this->headScript()->captureStart('text/javascript'); ?>
    $(document).ready(function(){
        $("li > div > a").nextAll().hide();
        $("li > div").hover(
              function () {
                  $('> a',this).nextAll().show();
              },
              function () {
                  $('> a',this).nextAll().hide();
              }
        );

    });
<?php $this->headScript()->captureEnd() ?>

<div id="page_content">
    <div id="pages_list">
    <?php 
        $blocks = $this->blocks;
        $mods = $this->mods;
        $modsacl = $this->modsacl;
        $previous_block = '';
        foreach ($this->sections as $key => $val){ 
            if ($previous_block <> $blocks["$val->bid"]){
            if ($previous_block <> '') {
                echo '</ul>';
            }
            echo '<h3>'.$blocks["$val->bid"].'</h3>';
            echo '<ul>';
            $previous_block = $blocks["$val->bid"];

            }
            if (!isset($modsacl[$val->mid]) && USER_ID <> 1) {
                $only_read = 'only_read';
                $href = "#";
            } else {
                $only_read = '';
                $href = ADMIN_URL.'/pages/modify/id/'.$val->id;
            }

          ?>
          <li>
            <div id="pagelist_item" class="no_hover i_<?= $this->modules[$val->mid] ?> i_mod">
            <a href="<?= $href ?>" class="<?= $only_read; ?><?php if ($val->visible == 2) echo ' section_hidden'; if ($val->visible == 4) echo ' section_closed'?>"><?= $val->name.' ('.$mods[$val->mid].')' ?></a>
            <a href="<?= ADMIN_URL; ?>/pages/settings/id/<?= $val->id ?>" title="<?= $this->t->_("Settings") ?>" class="nav_button edit_button"></a>
            <a href="<?= ADMIN_URL; ?>/pages/move/id/<?= $val->pid ?>/sid/<?= $val->id ?>/position/up" title="<?= $this->t->_("Up") ?>" class="nav_button up_button"></a>
            <a href="<?= ADMIN_URL; ?>/pages/move/id/<?= $val->pid ?>/sid/<?= $val->id ?>/position/down" title="<?= $this->t->_("Down") ?>" class="nav_button down_button"></a>
            <a href="#" id="<?= ADMIN_URL ?>/pages/delete/sid/<?= $val->id ?>" title="<?= $this->t->_("Delete") ?>" class="nav_button delete_button"></a>&nbsp;
            </div>
          </li>
      <?php  }
        if ($previous_block <> '') {
        echo '</ul>';
    }?>
    </div>

    <h2><?php echo $this->t->_("New section") ?></h2>
    <?php echo($this->form); ?>
</div>
<div id="sidebar">
    <a href="<?php echo ADMIN_URL.'/pages/edit/id/'.$this->page->id ?>" class="sidebar_button setting_button"><?php echo $this->t->_("Page settings") ?></a><br />
    <a href="#" id="/cp/pages/delete/id/61" title="Delete" id="delete_action" class="sidebar_button delete_button"><?php echo $this->t->_("Delete page") ?></a>

</div>




